import axios from 'axios'

const instance = axios.create({
	baseURL: import.meta.env.VITE_APP_URL,
	timeout: 10000
})

instance.interceptors.request.use(
	(config) => {
		return config
	},
	(error) => {
		console.error(error)
		return error
	}
)

instance.interceptors.response.use(
	(response) => {
		const result = response.data
		return result
	},
	(error) => {
		return error
	}
)

export default instance
